<?php

/**
 * Description of Asset Form Fields
 *
 * @author Admin
 */
class Asset_Resource_Formfield extends WOW_Model_Resource_Db_Table_Abstract implements
Asset_Resource_Formfield_Interface
{
    protected $_name = 'asset_form_details';
    protected $_primary = 'id';
    protected $_rowClass = 'Asset_Resource_Formfield_Item';
    protected $_dependentTables = array('Asset_Resource_Subcategory');

    public function getFormFieldsById($id)
    {
        return $this->find($id)->current();
    }

    public function getAllFormFields()
    {
        $select = $this->select()
                       ->order('FieldName DESC');
        //->order(array('line_items_per_product DESC','product_id'));
        // echo $select->__toString();

        return $this->fetchAll($select);
    }

    public function getFormFieldsByLabelId($labtid)
    {
        $select = $this->select()
                       ->where('AssetCatLabelId = ?', $labtid);

        return $this->fetchRow($select);
    }

}
?>

